﻿@{
    Layout = null;
}
@Content.Script(Url, "CodeManage/MutualCheck.js")

@*互查识别*@
<div class="mtlr15">

    <form class="form-horizontal" id="form" role="form" onkeydown="if(event.keyCode==13){return false;}">
        <input type="hidden" id="type" value="Fw_Code" />
        <div class="row">
            <div class="form-group col-xs-4 col-md-4 ">
                <label class="col-sm-4 control-label">防伪编码：</label>
                <div class="col-sm-8">
                    <textarea style="resize: none; width: 100%; height: 140px; border-radius: 4px;" id="FWtxt" name="Fw_Code" class="form-control"></textarea>
                </div>
            </div>
            <div class="col-sm-2 text-right">
                <button onclick="Transform()" id="transform" type="button" class="btn btn-success" style="padding-bottom: 0; margin-top: 50px;">
                    <i class="glyphicon glyphicon-resize-horizontal" style="font-size:25px"></i>
                </button>
            </div>
            <div class="form-group col-xs-4 col-md-4 ">
                <label class="col-sm-4 control-label">物流编码：</label>
                <div class="col-sm-8">
                    <textarea disabled="disabled" style="resize: none; width: 100%; height: 140px; border-radius: 4px;" id="WLtxt" name="Wl_Code" class="form-control"></textarea>
                </div>
            </div>
            <button type="button" class="btn btn-success" onclick="$.MGJ.MutualCheck.Ajax_GetMutualCheckList(1)">
                <i class="glyphicon glyphicon-search"></i>
                搜索
            </button>
        </div>

    </form>
    <div>
        <span>查询结果</span><span id="mag" class="red-600"></span>
    </div>
    
    <div id="Table">
        <div class="overflow">
            <table class="table table-hover table-bordered" style="text-align:center">
                <thead>
                    <tr>
                        <th width="15"><input type="checkbox" class="AllClickCheckbox"></th>
                        <th>单标防伪码</th>
                        <th>单标物流码</th>
                        <th>批次名</th>
                        @*<th>箱标物流码</th>
                    <th>箱标防伪码</th>*@
                        <th>状态</th>
                        <th>机构代码</th>
                        <th>机构名称</th>
                        <th>会员手机号</th>
                    </tr>
                </thead>
                <tbody id="MutualCheckTable" style="display:none" @*binding="{'emptyHtml':User_EmptyHtml}"*@>
                    <tr>
                        <td width="15"><input type="checkbox" class="AllClickChild"></td>
                        <td binding="{'text':'Fw_CodeSecret'}"></td>
                        <td binding="{'text':'Wl_Code'}"></td>
                        <td binding="{'text':'Wl_Code','textHandle':$.MGJ.MutualCheck.substring_batch}"></td>
                        @*<td binding="{'text':'ParentCode'}"></td>
                    <td binding="{'text':'BoxFW_Code'}"></td>*@
                        <td binding="{'text':'Stats','textHandle':$.MGJ.MutualCheck.Ajax_Flage}"></td>
                        <td binding="{'text':'Code'}"></td>
                        <td binding="{'text':'EnterpriseName'}"></td>
                        <td binding="{'text':'PersonMobile'}"></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script>
    var ColspanNub = $(".table.table-hover.table-bordered").find("tr").children("td").length
    window.User_EmptyHtml = '<tr><td colspan="' + ColspanNub + '"><p class="no-result">无符合条件的数据结果</p></td></tr>';
    $(function () {
        //$.MGJ.UserManager.Ajax_GetUserInfo(1);FWtxt     
    });
    function Transform() {
        if ($("#FWtxt").attr('disabled') == 'disabled') {
            $("#type").val("fw_Code");
            //$("#type").val("wl_Code");
            $("#FWtxt").removeAttr('disabled').val('');
            $("#WLtxt").attr('disabled', 'disabled').val('');
        }
        else {
            $("#type").val("wl_Code");
            //$("#type").val("wl_Cod+e");
            $("#WLtxt").removeAttr('disabled').val('');
            $("#FWtxt").attr('disabled', 'disabled').val('');
        }
        $(".has-error").removeClass("has-error");
        $(".help-block").hide();
    }

    $(function () {
        $('#form').bootstrapValidator({
            excluded: [':disabled'],
            fields: {
                Fw_Code: {
                    validators: {
                        notEmpty: {
                            message: '防伪编码不能为空'
                        },
                        stringLength: {
                            min: 18,
                            max: 24,
                            message: '防伪编码长度必须在18到24之间',
                        },
                        numeric: { message: '发票金额只能输入数字' },
                    }
                },
                Wl_Code: {
                    validators: {
                        notEmpty: {
                            message: '物流编码不能为空'
                        },
                        stringLength: {
                            min: 16,
                            max: 18,
                            message: '物流编码长度必须在16到18之间'
                        },
                        numeric: { message: '发票金额只能输入数字' },
                    }
                },
            }
        });
    })
    $(function () {
        function keyDown(event) {
            if (event.keyCode === 13) {
                $.MGJ.MutualCheck.Ajax_GetMutualCheckList(1, "");
            }
        }
        document.onkeydown = keyDown;
    })
</script>



